import java.util.Stack;

public class Vector implements Structura {
	int lungime;
	int positie;
	int element;
	int[] vector;
	Stack<Integer> sir = new Stack<Integer>();

	public Vector(int nr_elem) {
		this.lungime = nr_elem;
	}

	public void adauga(int elem) {
		sir.add(elem);
	}

	public void sterge(int elem) {
		if(sir.contains(elem)){
			sir.removeElementAt(sir.indexOf(elem));
		}else{
			System.out.println("Elementul nu exista in vector !!!");
		}
	}

	public int returneaza(int pos) {
		if(sir.elementAt(pos)!=null){
			element=sir.elementAt(pos);
			System.out.println("Elementul de la pozitia "+pos+" este : "+element);
		}
		else{
			System.out.println("Nu exista element la pozitia "+pos);
		}
		return element;
	}

	public String toString() {
		return sir.toString();
	}
}
